<template>
  <section class="one-key-bill">
   <information-bar :c-name="cName" :tax-amount="taxAmount"> </information-bar>
   <section class="common-block-section">
    <el-tabs v-model="activedName">
        <el-tab-pane label="个人所得税" name="first">
          <type-table :type="2" />
        </el-tab-pane>
        <el-tab-pane label="个人经营所得税" name="second">
          <type-table :type="5" />
        </el-tab-pane>
      </el-tabs>
   </section>
  </section>
  
</template>
<script>
import informationBar from "./informationBar"
import typeTable from "./typeTable"
export default {
  props:{
    
  },
  data(){
    return{
      cName:"",
      taxAmount:0,
      clientInfo:{},
      month:"",
      activedName: "first",
    }
  },
  created() {
    const data = localStorage.getItem("peopleIncomeTaxSalarys");
    if (data) {
      this.clientInfo = JSON.parse(data);
      this.cName = this.clientInfo.cName;
      this.month = this.getLastMonth();
    }
  },
  mounted(){
    this.loadData();
  },
  components:{
    informationBar,
    typeTable
  },
  methods:{
    loadData(){
    },
    getLastMonth(){
      var myDate = new Date();
      var tYear = myDate.getFullYear();
      var tMonth = myDate.getMonth();
      var m = tMonth;
      if (m==0){
        m = 12
      }
      if (m.toString().length == 1) {
          m = "0" + m;
      }
      var month = tYear + "-" + m;
      return month;
    },
    getTaxAmount(val){
      this.taxAmount = val;
    }
  }
}
</script>

<style lang="less" scoped>
.one-key-bill {
  padding: 0 10px;
  .top-line {
    padding-bottom: 10px;
  }
  .pagination {
    text-align: right;
    padding: 20px 0 0;
  }
}
</style>